<h1>Seiten Verwalten</h1>
<p>Seiten Bearbeiten, L&ouml;schen, Sortieren und On-/Offline schalten</p>

{foreach from=$cat_list item=cat key=cat_key}

{if count($cat.nav) neq 0}
<div class="block" id="page_mgr">
<h2>{$cat.cat->title|capitalize:true}</h2>

	<div id="cat_{$cat.cat->id}">
	{foreach from=$cat.nav item=item1 key=key1}
		<div id="element_{$key1}" class="row_markup color1">
			<div class="col_left">{$item1.title}</div>
			<div class="col_right">
				<a href="#ajax=page_edit&nav_id={$item1.id}" onclick="BkLoader.Get('&nav_id={$item1.id}').Load('page_edit')"><img src="{$theme}img/edit.png" border="0" /></a>
				{if $item1.status == 0}
				<a href="#" onclick="BkLoader.Get('&nav_id={$item1.id}&status=1').Load('page_mgr')"><img src="{$theme}img/status-off.png" border="0" /></a>
				{else}
				<a href="#" onclick="BkLoader.Get('&nav_id={$item1.id}&status=0').Load('page_mgr')"><img src="{$theme}img/status-on.png" border="0" /></a>
				{/if}
				<a onClick="return Backend.Confirm('{$item1.title}');" href="javascript:BkLoader.Get('nav_id={$item1.id}&del=true').Load('page_mgr');"><img src="{$theme}img/del.png" border="0" /></a>
			</div>
			
			<!-- load sub: 1 -->
			<div id="sub_{$item1.id}">
				{foreach from=$item1.sub item=item2 key=key2}
					<div id="element_{$key2}" class="row_markup color2">
						<div class="is_sub"><img src="{$theme}img/subnav.png" border="0" /></div>
						<div class="col_left">{$item2.title}</div>
						<div class="col_right">
							<a href="#ajax=page_edit&nav_id={$item2.id}" onclick="BkLoader.Get('&nav_id={$item2.id}').Load('page_edit')"><img src="{$theme}img/edit.png" border="0" /></a>
							{if $item2.status == 0}
							<a href="#" onclick="BkLoader.Get('&nav_id={$item2.id}&status=1').Load('page_mgr')"><img src="{$theme}img/status-off.png" border="0" /></a>
							{else}
							<a href="#" onclick="BkLoader.Get('&nav_id={$item2.id}&status=0').Load('page_mgr')"><img src="{$theme}img/status-on.png" border="0" /></a>
							{/if}
							<a onClick="return Backend.Confirm('{$item2.title}');" href="javascript:BkLoader.Get('nav_id={$item2.id}&del=true').Load('page_mgr');"><img src="{$theme}img/del.png" border="0" /></a>
						</div>  
						
						<!-- load sub: 2 -->
						<div id="subsub_{$item2.id}">
							{foreach from=$item2.sub item=item3 key=key3}
								<div id="element_{$key3}" class="row_markup color3">
									<div class="space">&nbsp;</div>
									<div class="is_sub"><img src="{$theme}img/subnav.png" border="0" /></div>
									<div class="col_left">{$item3.title}</div>
									<div class="col_right">
										<a href="#ajax=page_edit&nav_id={$item3.id}" onclick="BkLoader.Get('&nav_id={$item3.id}').Load('page_edit')"><img src="{$theme}img/edit.png" border="0" /></a>
										{if $item3.status == 0}
										<a href="#" onclick="BkLoader.Get('&nav_id={$item3.id}&status=1').Load('page_mgr')"><img src="{$theme}img/status-off.png" border="0" /></a>
										{else}
										<a href="#" onclick="BkLoader.Get('&nav_id={$item3.id}&status=0').Load('page_mgr')"><img src="{$theme}img/status-on.png" border="0" /></a>
										{/if}
										<a onClick="return Backend.Confirm('{$item3.title}');" href="javascript:BkLoader.Get('nav_id={$item3.id}&del=true').Load('page_mgr');"><img src="{$theme}img/del.png" border="0" /></a>
									</div>  		
								</div>
							{/foreach}	
						</div>
						<script type="text/javascript">{literal}
							Sortable.create('subsub_{/literal}{$item2.id}{literal}', { onUpdate : ListPages.Change , tag : 'div'});
						{/literal}</script>
						<!-- end sub: 2 -->
					</div>
					
					
				{/foreach} 	
			</div>
			<script type="text/javascript">{literal}
				Sortable.create('sub_{/literal}{$item1.id}{literal}', { onUpdate : ListPages.Change , tag : 'div'});
			{/literal}</script>
			<!-- end sub: 1 -->
	
	
		</div>	
	{/foreach}
	</div>
	
	<script type="text/javascript">{literal}
	Sortable.create('cat_{/literal}{$cat.cat->id}{literal}', { onUpdate : ListPages.Change , tag : 'div'});
	{/literal}</script>
</div>
{/if}
{/foreach}